package org.hypnus.e.engine.interceptor;

import java.util.Iterator;

import org.hypnus.e.engine.message.EngineContext;

public class InterceptorChain {

	
	private Iterator<Interceptor> it ;
	

	public Iterator<Interceptor> getIt() {
		return it;
	}

	public void setIt(Iterator<Interceptor> it) {
		this.it = it;
	}

	public void doBeforeInterceptor(EngineContext sCxt){
		if(it!=null && it.hasNext()){
			it.next().before(this,sCxt) ;
		}
	}
	
	public void doAfterInterceptor(EngineContext sCxt){
		if(it!=null && it.hasNext()){
			it.next().after(this,sCxt) ;
		}
	}
}
